/*
 * DesktopApplication1View.java
 */
package desktopapplication1;

import bean.ConsultaCita;
import fachada.FachadaCita;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.sql.Date;
import java.util.Vector;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import app.Com;
import app.Parameters;
import bean.CaracteristicasConsulta;
import bean.Consulta;
import bean.Prueba50m;
import bean.Usuario;
import fachada.FachadaConsulta;
import fachada.FachadaFisico1;
import fachada.FachadaFisico2;
import java.math.BigDecimal;
import java.awt.*;
import javax.swing.*;

/**
 * The application's main frame.
 */
public class DesktopApplication1View extends FrameView {

    Calendar calendario = Calendar.getInstance();
    ArrayList<ConsultaCita> pacientesxDia = new ArrayList<ConsultaCita>();
    //instanciar puerto
    Com com;
    int evaluacion;
    public String idPull;
    public String idEvaluacionPaciente;   

    public DesktopApplication1View(SingleFrameApplication app) {
        super(app);
        initComponents();
        //inicializo lo miooo
        ponerFecha();
        jTabbedPane1.setSelectedIndex(ddPruebas.getSelectedIndex());
        Vector abc = new Vector();
        Dispositivo oDispositivo = new Dispositivo();
        ddPuerto.setModel(new javax.swing.DefaultComboBoxModel(oDispositivo.getPuertosLibres()));

//        verConsultas();
        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {

            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String) (evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer) (evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = DesktopApplication1.getApplication().getMainFrame();
            aboutBox = new DesktopApplication1AboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        DesktopApplication1.getApplication().show(aboutBox);
    }

    private boolean IngresarConsulta() {
        boolean retorno = false;
        Consulta oConsulta = new Consulta();
        java.util.Date now = new java.util.Date();
        java.sql.Date sysdate = new java.sql.Date(now.getTime());
        oConsulta.setFecha(sysdate);
        Usuario uPaciente = new Usuario();
        Usuario uEspecialista = new Usuario();
        uEspecialista.setIdUsuario(txtCedula.getText());
        uPaciente.setIdUsuario(txtParticipante.getText());
        oConsulta.setIdEspecialista(uEspecialista);
        oConsulta.setIdPaciente(uPaciente);
        oConsulta.setNroEvaluacion(new BigDecimal(evaluacion));
        FachadaConsulta oFachadaConsulta = new FachadaConsulta();
        String sResultado = oFachadaConsulta.insertarConsulta(oConsulta);
        if (sResultado == null) {
            retorno = true;
        } else {
            lblError.setText("No se inserto la consulta " + sResultado);
        }

        return retorno;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tableConsultas = new javax.swing.JTable();
        ddTurnos = new javax.swing.JComboBox();
        jButton3 = new javax.swing.JButton();
        txtEnsayo = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        txtCedula = new javax.swing.JTextField();
        txtPull = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        txttricepsder = new javax.swing.JTextField();
        txtbicepsder = new javax.swing.JTextField();
        txtCuadricepsDer = new javax.swing.JTextField();
        txtIzquiotibialDer = new javax.swing.JTextField();
        txttriceptsizq = new javax.swing.JTextField();
        txtbicepsizq = new javax.swing.JTextField();
        txtCuadricepsIzq = new javax.swing.JTextField();
        txtIzquiotibialIzq = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        btnFuerza = new javax.swing.JButton();
        lblKilos = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        txtAltura = new javax.swing.JTextField();
        txtBrazoExtendido = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        txtSalto = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        txtReaccion = new javax.swing.JTextField();
        btnSaltabilidad = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        txt30Metros = new javax.swing.JTextField();
        txt40Metros = new javax.swing.JTextField();
        txt50Metros = new javax.swing.JTextField();
        txt20Metros = new javax.swing.JTextField();
        txt10Metros = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        distanciacono2 = new javax.swing.JTextField();
        distanciacono1 = new javax.swing.JTextField();
        distanciacono3 = new javax.swing.JTextField();
        distanciacono4 = new javax.swing.JTextField();
        distanciacono5 = new javax.swing.JTextField();
        btnVelocidad = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        habilitadocono4 = new javax.swing.JCheckBox();
        habilitadocono3 = new javax.swing.JCheckBox();
        habilitadocono2 = new javax.swing.JCheckBox();
        habilitadocono1 = new javax.swing.JCheckBox();
        jLabel36 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        ddPruebas = new javax.swing.JComboBox();
        jLabel7 = new javax.swing.JLabel();
        txtParticipante = new javax.swing.JLabel();
        txtNombreParticipante = new javax.swing.JLabel();
        ddPuerto = new javax.swing.JComboBox();
        jLabel14 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        txtParticipante1 = new javax.swing.JLabel();
        lblError = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        txtApellido = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(desktopapplication1.DesktopApplication1.class).getContext().getResourceMap(DesktopApplication1View.class);
        mainPanel.setBackground(resourceMap.getColor("mainPanel.background")); // NOI18N
        mainPanel.setName("mainPanel"); // NOI18N

        jScrollPane1.setBackground(resourceMap.getColor("jScrollPane1.background")); // NOI18N
        jScrollPane1.setName("jScrollPane1"); // NOI18N

        tableConsultas.setBackground(resourceMap.getColor("tableConsultas.background")); // NOI18N
        tableConsultas.setForeground(resourceMap.getColor("tableConsultas.foreground")); // NOI18N
        tableConsultas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Identificación", "Apellido", "Nombres", "Institución", "Pull", "Evaluacion"
            }
        ));
        tableConsultas.setName("tableConsultas"); // NOI18N
        jScrollPane1.setViewportView(tableConsultas);
        tableConsultas.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("tableConsultas.columnModel.title3")); // NOI18N
        tableConsultas.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("tableConsultas.columnModel.title0")); // NOI18N
        tableConsultas.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("tableConsultas.columnModel.title1")); // NOI18N
        tableConsultas.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("tableConsultas.columnModel.title2")); // NOI18N
        tableConsultas.getColumnModel().getColumn(4).setMinWidth(0);
        tableConsultas.getColumnModel().getColumn(4).setMaxWidth(0);
        tableConsultas.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("tableConsultas.columnModel.title4")); // NOI18N
        tableConsultas.getColumnModel().getColumn(5).setMinWidth(0);
        tableConsultas.getColumnModel().getColumn(5).setMaxWidth(0);
        tableConsultas.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("tableConsultas.columnModel.title5")); // NOI18N

        ddTurnos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00", " " }));
        ddTurnos.setSelectedIndex(8);
        ddTurnos.setName("ddTurnos"); // NOI18N

        jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
        jButton3.setName("jButton3"); // NOI18N
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        txtEnsayo.setEditable(false);
        txtEnsayo.setName("txtEnsayo"); // NOI18N

        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        txtCedula.setText(resourceMap.getString("txtName.text")); // NOI18N
        txtCedula.setName("txtName"); // NOI18N

        txtPull.setText(resourceMap.getString("txtPull.text")); // NOI18N
        txtPull.setName("txtPull"); // NOI18N

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        jPanel3.setBackground(resourceMap.getColor("jPanel3.background")); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel8.setIcon(resourceMap.getIcon("jLabel8.icon")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jLabel15.setFont(resourceMap.getFont("jLabel15.font")); // NOI18N
        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jLabel16.setFont(resourceMap.getFont("jLabel16.font")); // NOI18N
        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jLabel17.setFont(resourceMap.getFont("jLabel17.font")); // NOI18N
        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jLabel18.setFont(resourceMap.getFont("jLabel18.font")); // NOI18N
        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        txttricepsder.setEditable(false);
        txttricepsder.setFont(resourceMap.getFont("txttricepsder.font")); // NOI18N
        txttricepsder.setName("txttricepsder"); // NOI18N
        txttricepsder.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txttricepsderMouseClicked(evt);
            }
        });

        txtbicepsder.setEditable(false);
        txtbicepsder.setFont(resourceMap.getFont("txtbicepsder.font")); // NOI18N
        txtbicepsder.setName("txtbicepsder"); // NOI18N
        txtbicepsder.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtbicepsderMouseClicked(evt);
            }
        });

        txtCuadricepsDer.setEditable(false);
        txtCuadricepsDer.setFont(resourceMap.getFont("txtCuadricepsDer.font")); // NOI18N
        txtCuadricepsDer.setName("txtCuadricepsDer"); // NOI18N
        txtCuadricepsDer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtCuadricepsDerMouseClicked(evt);
            }
        });

        txtIzquiotibialDer.setEditable(false);
        txtIzquiotibialDer.setFont(resourceMap.getFont("txtIzquiotibialDer.font")); // NOI18N
        txtIzquiotibialDer.setName("txtIzquiotibialDer"); // NOI18N
        txtIzquiotibialDer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtIzquiotibialDerMouseClicked(evt);
            }
        });

        txttriceptsizq.setEditable(false);
        txttriceptsizq.setFont(resourceMap.getFont("txttriceptsizq.font")); // NOI18N
        txttriceptsizq.setName("txttriceptsizq"); // NOI18N
        txttriceptsizq.setPreferredSize(new java.awt.Dimension(6, 30));
        txttriceptsizq.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txttriceptsizqMouseClicked(evt);
            }
        });

        txtbicepsizq.setEditable(false);
        txtbicepsizq.setFont(resourceMap.getFont("txtbicepsizq.font")); // NOI18N
        txtbicepsizq.setName("txtbicepsizq"); // NOI18N
        txtbicepsizq.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtbicepsizqMouseClicked(evt);
            }
        });

        txtCuadricepsIzq.setEditable(false);
        txtCuadricepsIzq.setFont(resourceMap.getFont("txtCuadricepsIzq.font")); // NOI18N
        txtCuadricepsIzq.setName("txtCuadricepsIzq"); // NOI18N
        txtCuadricepsIzq.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtCuadricepsIzqMouseClicked(evt);
            }
        });

        txtIzquiotibialIzq.setEditable(false);
        txtIzquiotibialIzq.setFont(resourceMap.getFont("txtIzquiotibialIzq.font")); // NOI18N
        txtIzquiotibialIzq.setName("txtIzquiotibialIzq"); // NOI18N
        txtIzquiotibialIzq.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                txtIzquiotibialIzqMouseClicked(evt);
            }
        });

        jLabel19.setFont(resourceMap.getFont("jLabel19.font")); // NOI18N
        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jLabel20.setFont(resourceMap.getFont("jLabel20.font")); // NOI18N
        jLabel20.setForeground(resourceMap.getColor("jLabel20.foreground")); // NOI18N
        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        btnFuerza.setText(resourceMap.getString("btnFuerza.text")); // NOI18N
        btnFuerza.setName("btnFuerza"); // NOI18N
        btnFuerza.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFuerzaActionPerformed(evt);
            }
        });

        lblKilos.setFont(resourceMap.getFont("lblKilos.font")); // NOI18N
        lblKilos.setForeground(resourceMap.getColor("lblKilos.foreground")); // NOI18N
        lblKilos.setText(resourceMap.getString("lblKilos.text")); // NOI18N
        lblKilos.setName("lblKilos"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 770, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(132, 132, 132)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel17)
                                    .addComponent(jLabel16)
                                    .addComponent(jLabel18)
                                    .addComponent(jLabel15))
                                .addGap(28, 28, 28)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel19)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(txtIzquiotibialDer, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txtCuadricepsDer, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txtbicepsder, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txttricepsder, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(33, 33, 33)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(txtIzquiotibialIzq)
                                    .addComponent(txtCuadricepsIzq)
                                    .addComponent(jLabel20)
                                    .addComponent(txtbicepsizq, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(txttriceptsizq, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE)
                                .addComponent(lblKilos, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(36, 36, 36))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(btnFuerza, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 530, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                .addGap(28, 28, 28)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel19)
                                    .addComponent(jLabel20))
                                .addGap(24, 24, 24)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                        .addComponent(txttriceptsizq, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(txtbicepsizq, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(txtCuadricepsIzq, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(txtIzquiotibialIzq, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(txttricepsder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(txtbicepsder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(20, 20, 20)
                                        .addComponent(txtCuadricepsDer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(txtIzquiotibialDer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel15)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel16)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel17)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel18)))
                        .addGap(18, 18, 18)
                        .addComponent(btnFuerza, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblKilos, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(42, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

        jPanel2.setBackground(resourceMap.getColor("jPanel2.background")); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel21.setIcon(resourceMap.getIcon("jLabel21.icon")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        jLabel22.setFont(resourceMap.getFont("jLabel23.font")); // NOI18N
        jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
        jLabel22.setName("jLabel22"); // NOI18N

        txtAltura.setEditable(false);
        txtAltura.setFont(resourceMap.getFont("txtBrazoExtendido.font")); // NOI18N
        txtAltura.setName("txtAltura"); // NOI18N

        txtBrazoExtendido.setEditable(false);
        txtBrazoExtendido.setFont(resourceMap.getFont("txtBrazoExtendido.font")); // NOI18N
        txtBrazoExtendido.setName("txtBrazoExtendido"); // NOI18N

        jLabel23.setFont(resourceMap.getFont("jLabel23.font")); // NOI18N
        jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
        jLabel23.setName("jLabel23"); // NOI18N

        jLabel24.setFont(resourceMap.getFont("jLabel23.font")); // NOI18N
        jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
        jLabel24.setName("jLabel24"); // NOI18N

        txtSalto.setEditable(false);
        txtSalto.setFont(resourceMap.getFont("txtBrazoExtendido.font")); // NOI18N
        txtSalto.setName("txtSalto"); // NOI18N

        jLabel25.setFont(resourceMap.getFont("jLabel23.font")); // NOI18N
        jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
        jLabel25.setName("jLabel25"); // NOI18N

        txtReaccion.setFont(resourceMap.getFont("txtBrazoExtendido.font")); // NOI18N
        txtReaccion.setName("txtReaccion"); // NOI18N

        btnSaltabilidad.setText(resourceMap.getString("btnSaltabilidad.text")); // NOI18N
        btnSaltabilidad.setName("btnSaltabilidad"); // NOI18N
        btnSaltabilidad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaltabilidadActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel21)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(77, 77, 77)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel22)
                    .addComponent(jLabel23)
                    .addComponent(jLabel24)
                    .addComponent(jLabel25))
                .addGap(38, 38, 38)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnSaltabilidad)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(txtSalto, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)
                        .addComponent(txtReaccion)
                        .addComponent(txtBrazoExtendido)
                        .addComponent(txtAltura))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(jLabel21)
                .addGap(37, 37, 37)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel22)
                    .addComponent(txtAltura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(txtBrazoExtendido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(txtSalto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(txtReaccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel24)
                        .addGap(27, 27, 27)
                        .addComponent(jLabel25)))
                .addGap(27, 27, 27)
                .addComponent(btnSaltabilidad)
                .addContainerGap(97, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

        jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel6.setIcon(resourceMap.getIcon("jLabel6.icon")); // NOI18N
        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        txt30Metros.setEditable(false);
        txt30Metros.setFont(resourceMap.getFont("txt30Metros.font")); // NOI18N
        txt30Metros.setName("txt30Metros"); // NOI18N

        txt40Metros.setEditable(false);
        txt40Metros.setFont(resourceMap.getFont("txt40Metros.font")); // NOI18N
        txt40Metros.setName("txt40Metros"); // NOI18N

        txt50Metros.setEditable(false);
        txt50Metros.setFont(resourceMap.getFont("txt50Metros.font")); // NOI18N
        txt50Metros.setName("txt50Metros"); // NOI18N

        txt20Metros.setEditable(false);
        txt20Metros.setFont(resourceMap.getFont("txt20Metros.font")); // NOI18N
        txt20Metros.setName("txt20Metros"); // NOI18N

        txt10Metros.setEditable(false);
        txt10Metros.setFont(resourceMap.getFont("txt10Metros.font")); // NOI18N
        txt10Metros.setName("txt10Metros"); // NOI18N
        txt10Metros.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                txt10MetrosKeyTyped(evt);
            }
        });

        jLabel11.setFont(resourceMap.getFont("jLabel11.font")); // NOI18N
        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jLabel10.setFont(resourceMap.getFont("jLabel10.font")); // NOI18N
        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jLabel9.setFont(resourceMap.getFont("jLabel9.font")); // NOI18N
        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel12.setFont(resourceMap.getFont("jLabel12.font")); // NOI18N
        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        distanciacono2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        distanciacono2.setText(resourceMap.getString("distanciacono2.text")); // NOI18N
        distanciacono2.setName("distanciacono2"); // NOI18N
        distanciacono2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                distanciacono2KeyTyped(evt);
            }
        });

        distanciacono1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        distanciacono1.setText(resourceMap.getString("distanciacono1.text")); // NOI18N
        distanciacono1.setToolTipText(resourceMap.getString("distanciacono1.toolTipText")); // NOI18N
        distanciacono1.setName("distanciacono1"); // NOI18N
        distanciacono1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                distanciacono1KeyTyped(evt);
            }
        });

        distanciacono3.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        distanciacono3.setText(resourceMap.getString("distanciacono3.text")); // NOI18N
        distanciacono3.setName("distanciacono3"); // NOI18N
        distanciacono3.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                distanciacono3KeyTyped(evt);
            }
        });

        distanciacono4.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        distanciacono4.setText(resourceMap.getString("distanciacono4.text")); // NOI18N
        distanciacono4.setName("distanciacono4"); // NOI18N
        distanciacono4.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                distanciacono4KeyTyped(evt);
            }
        });

        distanciacono5.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        distanciacono5.setText(resourceMap.getString("distanciacono5.text")); // NOI18N
        distanciacono5.setName("distanciacono5"); // NOI18N
        distanciacono5.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                distanciacono5KeyTyped(evt);
            }
        });

        btnVelocidad.setText(resourceMap.getString("btnVelocidad.text")); // NOI18N
        btnVelocidad.setName("btnVelocidad"); // NOI18N
        btnVelocidad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVelocidadActionPerformed(evt);
            }
        });

        jLabel13.setFont(resourceMap.getFont("jLabel13.font")); // NOI18N
        jLabel13.setForeground(resourceMap.getColor("jLabel13.foreground")); // NOI18N
        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        habilitadocono4.setBackground(resourceMap.getColor("habilitadocono4.background")); // NOI18N
        habilitadocono4.setSelected(true);
        habilitadocono4.setText(resourceMap.getString("habilitadocono4.text")); // NOI18N
        habilitadocono4.setName("habilitadocono4"); // NOI18N

        habilitadocono3.setBackground(resourceMap.getColor("habilitadocono3.background")); // NOI18N
        habilitadocono3.setSelected(true);
        habilitadocono3.setText(resourceMap.getString("habilitadocono3.text")); // NOI18N
        habilitadocono3.setName("habilitadocono3"); // NOI18N

        habilitadocono2.setBackground(resourceMap.getColor("habilitadocono2.background")); // NOI18N
        habilitadocono2.setSelected(true);
        habilitadocono2.setText(resourceMap.getString("habilitadocono2.text")); // NOI18N
        habilitadocono2.setName("habilitadocono2"); // NOI18N

        habilitadocono1.setBackground(resourceMap.getColor("habilitadocono1.background")); // NOI18N
        habilitadocono1.setSelected(true);
        habilitadocono1.setText(resourceMap.getString("habilitadocono1.text")); // NOI18N
        habilitadocono1.setName("habilitadocono1"); // NOI18N

        jLabel36.setBackground(resourceMap.getColor("jLabel36.background")); // NOI18N
        jLabel36.setFont(resourceMap.getFont("jLabel36.font")); // NOI18N
        jLabel36.setText(resourceMap.getString("jLabel36.text")); // NOI18N
        jLabel36.setName("jLabel36"); // NOI18N

        jLabel38.setText(resourceMap.getString("jLabel38.text")); // NOI18N
        jLabel38.setName("jLabel38"); // NOI18N

        jLabel27.setIcon(resourceMap.getIcon("jLabel27.icon")); // NOI18N
        jLabel27.setText(resourceMap.getString("jLabel27.text")); // NOI18N
        jLabel27.setToolTipText(resourceMap.getString("jLabel27.toolTipText")); // NOI18N
        jLabel27.setName("jLabel27"); // NOI18N

        jLabel28.setIcon(resourceMap.getIcon("jLabel28.icon")); // NOI18N
        jLabel28.setText(resourceMap.getString("jLabel28.text")); // NOI18N
        jLabel28.setName("jLabel28"); // NOI18N

        jLabel29.setIcon(resourceMap.getIcon("jLabel29.icon")); // NOI18N
        jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
        jLabel29.setName("jLabel29"); // NOI18N

        jLabel30.setIcon(resourceMap.getIcon("jLabel30.icon")); // NOI18N
        jLabel30.setText(resourceMap.getString("jLabel30.text")); // NOI18N
        jLabel30.setName("jLabel30"); // NOI18N

        jLabel31.setIcon(resourceMap.getIcon("jLabel31.icon")); // NOI18N
        jLabel31.setText(resourceMap.getString("jLabel31.text")); // NOI18N
        jLabel31.setName("jLabel31"); // NOI18N

        jLabel32.setIcon(resourceMap.getIcon("jLabel32.icon")); // NOI18N
        jLabel32.setText(resourceMap.getString("jLabel32.text")); // NOI18N
        jLabel32.setName("jLabel32"); // NOI18N

        jLabel33.setIcon(resourceMap.getIcon("jLabel33.icon")); // NOI18N
        jLabel33.setText(resourceMap.getString("jLabel33.text")); // NOI18N
        jLabel33.setName("jLabel33"); // NOI18N

        jLabel34.setIcon(resourceMap.getIcon("jLabel34.icon")); // NOI18N
        jLabel34.setText(resourceMap.getString("jLabel34.text")); // NOI18N
        jLabel34.setName("jLabel34"); // NOI18N

        jLabel35.setIcon(resourceMap.getIcon("jLabel35.icon")); // NOI18N
        jLabel35.setText(resourceMap.getString("jLabel35.text")); // NOI18N
        jLabel35.setName("jLabel35"); // NOI18N

        jLabel37.setIcon(resourceMap.getIcon("jLabel37.icon")); // NOI18N
        jLabel37.setText(resourceMap.getString("jLabel37.text")); // NOI18N
        jLabel37.setToolTipText(resourceMap.getString("jLabel37.toolTipText")); // NOI18N
        jLabel37.setName("jLabel37"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(habilitadocono1)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(habilitadocono3)
                                    .addComponent(habilitadocono2)
                                    .addComponent(habilitadocono4))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel12)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(3, 3, 3)
                                        .addComponent(jLabel9))
                                    .addComponent(jLabel10)
                                    .addComponent(jLabel11))))
                        .addGap(31, 31, 31))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap(66, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel13)
                        .addGap(29, 29, 29)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel38)
                        .addGap(83, 83, 83)
                        .addComponent(jLabel36)
                        .addGap(83, 83, 83))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel33, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabel27, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel29, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel31, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel35)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txt30Metros, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)
                            .addComponent(txt50Metros, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)
                            .addComponent(txt40Metros, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)
                            .addComponent(txt20Metros, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)
                            .addComponent(txt10Metros, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel28)
                            .addComponent(jLabel30)
                            .addComponent(jLabel37)
                            .addComponent(jLabel32)
                            .addComponent(jLabel34))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(distanciacono2, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(distanciacono4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE)
                                    .addComponent(distanciacono5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE))
                                .addGap(18, 18, 18)
                                .addComponent(btnVelocidad, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(distanciacono3, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(distanciacono1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE)))))
                .addGap(112, 112, 112)
                .addComponent(jLabel2)
                .addGap(95, 95, 95))
            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 846, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(122, 122, 122)
                        .addComponent(jLabel2))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel36)
                                .addComponent(jLabel38))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(20, 20, 20)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addGap(18, 18, 18)
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                                        .addGap(64, 64, 64)
                                                        .addComponent(jLabel29))
                                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                                        .addGap(63, 63, 63)
                                                        .addComponent(jLabel30))
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                                        .addComponent(txt10Metros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addComponent(txt20Metros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(23, 23, 23))))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addGap(26, 26, 26)
                                                .addComponent(distanciacono1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(58, 58, 58)
                                                .addComponent(distanciacono3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addGap(27, 27, 27)
                                                .addComponent(txt30Metros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(txt40Metros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(24, 24, 24))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addComponent(jLabel31)
                                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                                    .addComponent(distanciacono2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(btnVelocidad, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                .addGap(27, 27, 27)))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jLabel33, javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                                                .addComponent(distanciacono4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(22, 22, 22))))
                                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                                        .addGap(5, 5, 5)
                                                        .addComponent(jLabel32)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jLabel34)))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel35))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addGap(29, 29, 29)
                                                .addComponent(txt50Metros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jLabel37))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addGap(29, 29, 29)
                                                .addComponent(distanciacono5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(jLabel27, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel28, javax.swing.GroupLayout.Alignment.LEADING))))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(31, 31, 31)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(109, 109, 109)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(habilitadocono2)
                                            .addComponent(jLabel10))
                                        .addGap(45, 45, 45)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(habilitadocono3)
                                            .addComponent(jLabel11))
                                        .addGap(49, 49, 49)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(habilitadocono4)
                                            .addComponent(jLabel12)))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(habilitadocono1)
                                            .addComponent(jLabel9))))
                                .addGap(43, 43, 43)
                                .addComponent(jLabel13)))))
                .addContainerGap(45, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        ddPruebas.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-Seleccione-", "Velocidad", "Fuerza", "Saltabilidad" }));
        ddPruebas.setName("ddPruebas"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        txtParticipante.setFont(resourceMap.getFont("txtParticipante.font")); // NOI18N
        txtParticipante.setText(resourceMap.getString("txtParticipante.text")); // NOI18N
        txtParticipante.setName("txtParticipante"); // NOI18N

        txtNombreParticipante.setFont(resourceMap.getFont("txtNombreParticipante.font")); // NOI18N
        txtNombreParticipante.setText(resourceMap.getString("txtNombreParticipante.text")); // NOI18N
        txtNombreParticipante.setName("txtNombreParticipante"); // NOI18N

        ddPuerto.setName("ddPuerto"); // NOI18N
        ddPuerto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ddPuertoActionPerformed(evt);
            }
        });

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N
        jButton5.setActionCommand(resourceMap.getString("jButton5.actionCommand")); // NOI18N
        jButton5.setName("jButton5"); // NOI18N
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        txtParticipante1.setFont(resourceMap.getFont("txtParticipante1.font")); // NOI18N
        txtParticipante1.setText(resourceMap.getString("txtParticipante1.text")); // NOI18N
        txtParticipante1.setName("txtParticipante1"); // NOI18N

        lblError.setFont(resourceMap.getFont("lblError.font")); // NOI18N
        lblError.setForeground(resourceMap.getColor("lblError.foreground")); // NOI18N
        lblError.setText(resourceMap.getString("lblError.text")); // NOI18N
        lblError.setName("lblError"); // NOI18N

        jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
        jButton4.setName("jButton4"); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        txtApellido.setText(resourceMap.getString("txtApellido.text")); // NOI18N
        txtApellido.setName("txtApellido"); // NOI18N

        jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
        jLabel26.setName("jLabel26"); // NOI18N

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel4)
                            .addComponent(jLabel7)
                            .addComponent(jLabel14))
                        .addGap(79, 79, 79)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtPull, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ddPruebas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtCedula, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ddPuerto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(46, 46, 46)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel26))
                                .addGap(18, 18, 18)
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(mainPanelLayout.createSequentialGroup()
                                        .addComponent(ddTurnos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(44, 44, 44)
                                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jButton2))
                                    .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(mainPanelLayout.createSequentialGroup()
                                        .addComponent(txtEnsayo, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jButton3))
                                    .addGroup(mainPanelLayout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(18, 18, 18)
                                .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addComponent(jButton4)
                                .addGap(105, 105, 105)
                                .addComponent(lblError, javax.swing.GroupLayout.PREFERRED_SIZE, 422, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addGap(27, 27, 27)
                                .addComponent(txtNombreParticipante))
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addGap(7, 7, 7)
                                .addComponent(txtParticipante1)))
                        .addGap(147, 147, 147)
                        .addComponent(txtParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 605, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 764, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel4)
                                    .addComponent(txtCedula, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel5)
                                    .addComponent(txtPull, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel7)
                                    .addComponent(ddPruebas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(mainPanelLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(ddTurnos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel3)
                                    .addComponent(jButton2)
                                    .addComponent(txtEnsayo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel26)
                                    .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                                .addGap(25, 25, 25)
                                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtParticipante1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(13, 13, 13)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14)
                            .addComponent(ddPuerto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton4)
                            .addComponent(lblError, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(29, 29, 29))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(34, 34, 34)
                        .addComponent(txtParticipante, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(5, 5, 5)
                        .addComponent(txtNombreParticipante)
                        .addGap(45, 45, 45)))
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 555, Short.MAX_VALUE))))
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(desktopapplication1.DesktopApplication1.class).getContext().getActionMap(DesktopApplication1View.class, this);
        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 1237, Short.MAX_VALUE)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusAnimationLabel)
                .addContainerGap())
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 1407, Short.MAX_VALUE)
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed

        calendario.add(Calendar.DATE, 1);
        ponerFecha();
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        calendario.add(Calendar.DATE, -1);
        ponerFecha();

    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        if (!validarCampos()) {
            return;
        }
        verConsultas();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        try {
            if (!validarCampos()) {
                return;
            }
            int tipoPrueba = ddPruebas.getSelectedIndex();
            jButton5.setEnabled(false);

            Dispositivo oDispositivo = new Dispositivo();
            String resultado = null;
            try {
                resultado = oDispositivo.obtenerPrueba(com);
                if (resultado.equals("")) {
                    jButton5.setEnabled(true);
                    lblError.setText("No se encontró respuesta en el dispositivo");
                    return;
                } else {
                    lblError.setText("");
                }
            } catch (Exception e) {
                lblError.setText("Error de conexión al dispositivo" + e.getMessage());
            }
            switch (tipoPrueba) {
                case 1:
                    //Velocidad
                    while (resultado.length() < 8) {
                        resultado = oDispositivo.obtenerPrueba(com);
                    }
                    String minutos = resultado.substring(2, 4);
                    String segundos = resultado.substring(4, 6);
                    String milesimas = resultado.substring(6, 10);
                    int min = Integer.parseInt(minutos, 16);
                    int seg = Integer.parseInt(segundos, 16);
                    int miles = Integer.parseInt(milesimas, 16);
                    String total = min + ":" + seg + ":" + miles;
                    txt10Metros.setText(validarMilesimas(total, ":"));
                    minutos = resultado.substring(10, 12);
                    segundos = resultado.substring(12, 14);
                    milesimas = resultado.substring(14, 18);
                    min = Integer.parseInt(minutos, 16);
                    seg = Integer.parseInt(segundos, 16);
                    miles = Integer.parseInt(milesimas, 16);
                    total = min + ":" + seg + ":" + miles;
                    txt20Metros.setText(validarMilesimas(total, ":"));
                    minutos = resultado.substring(18, 20);
                    segundos = resultado.substring(20, 22);
                    milesimas = resultado.substring(22, 26);
                    min = Integer.parseInt(minutos, 16);
                    seg = Integer.parseInt(segundos, 16);
                    miles = Integer.parseInt(milesimas, 16);
                    total = min + ":" + seg + ":" + miles;
                    txt30Metros.setText(validarMilesimas(total, ":"));
                    minutos = resultado.substring(26, 28);
                    segundos = resultado.substring(28, 30);
                    milesimas = resultado.substring(30, 34);
                    min = Integer.parseInt(minutos, 16);
                    seg = Integer.parseInt(segundos, 16);
                    miles = Integer.parseInt(milesimas, 16);
                    total = min + ":" + seg + ":" + miles;
                    txt40Metros.setText(validarMilesimas(total, ":"));
                    minutos = resultado.substring(34, 36);
                    segundos = resultado.substring(36, 38);
                    milesimas = resultado.substring(38, 42);
                    min = Integer.parseInt(minutos, 16);
                    seg = Integer.parseInt(segundos, 16);
                    miles = Integer.parseInt(milesimas, 16);
                    total = min + ":" + seg + ":" + miles;
                    txt50Metros.setText(validarMilesimas(total, ":"));
                    break;
                case 2:
                    //Fuerza
                    String kilos = "";
                    for (int i = 0; i < 50; i++) {
                        //descanso 0.1 segundo y entro 10 veces, osea 4 segundos
                        resultado = oDispositivo.obtenerPrueba(com);
                        System.out.println("resultado " + resultado);

                        if (resultado.length() > 0) {
                            if (kilos.isEmpty()) {
                                String d = String.valueOf(getFuerza(1, resultado.length(), resultado));
                                // lblKilos.setText(d);
                                kilos = d;
                            } else {
                                double anterior = Double.parseDouble(kilos.toString());
                                String d = String.valueOf(getFuerza(1, resultado.length(), resultado));
                                double actual = Double.parseDouble(d);
                                // System.out.println("actual: " + actual + " anterior: "+anterior);
                                if (actual > anterior) {
                                    //lblKilos.setText(actual + "");
                                    kilos = actual + "";
                                }
                            }

                            // final String k = kilos;
                            Thread.sleep(100);
                            /* Runnable setTextRun = new Runnable() {

                            public void run() {
                            System.out.println("about to do setText() ");
                            lblKilos.setText(k);
                            }
                            };
                             */
                            //System.out.println("about to invokeAndWait()");
                            //SwingUtilities.invokeAndWait(setTextRun);

                            // System.out.println("back from invokeAndWait()");

                            /* if(SwingUtilities.isEventDispatchThread()) {
                            // set of code here
                            } else  {
                            SwingUtilities.invokeAndWait(new Runnable() {

                            @Override
                            public void run() {
                            System.out.println("llamo a run");
                            lblKilos.setText(k);
                            }
                            });*/
                            System.out.println("kilos final: " + kilos);
                        }

                    }
                    lblKilos.setText(kilos);
                    /*catch (java.lang.reflect.InvocationTargetException x) {
                    System.out.print("exception thrown from run()");
                    }*/

//                    String sTricepsDer = getFuerza(2, 6, resultado);
//                String sTricepsIzq = getFuerza(6, 10, resultado);
//                String sBicepsDer = getFuerza(10, 14, resultado);
//                String sBicepsIzq = getFuerza(14, 18, resultado);
//                String sCuadricepsDer = getFuerza(18, 22, resultado);
//                String sCuadricepsIzq = getFuerza(22, 26, resultado);
//                String sIzquiotibialesDer = getFuerza(26, 30, resultado);
//                String sIzquiotibialesIzq = getFuerza(30, 34, resultado);
//
//                  sTricepsDer = resultado;
//
//                txttricepsder.setText(sTricepsDer);
//                txttriceptsizq.setText(sTricepsIzq);
//                txtbicepsder.setText(sBicepsDer);
//                txtbicepsizq.setText(sBicepsIzq);
//                txtCuadricepsDer.setText(sCuadricepsDer);
//                txtCuadricepsIzq.setText(sCuadricepsIzq);
//                txtIzquiotibialDer.setText(sIzquiotibialesDer);
//                txtIzquiotibialIzq.setText(sIzquiotibialesIzq);
                    break;


                case 3:
                    //Saltabilidad
                    String sAltura = getSaltabilidad(7, 10, resultado);
                    String sBrazoExtendido = getSaltabilidad(15, 18, resultado);
                    String sSalto = getSaltabilidad(23, 26, resultado);
                    // se debe ingresar en metros
                    double reaccion = new Double(getSaltabilidad(31, 34, resultado));
                    reaccion = reaccion * 100;
                    String sReaccion = redondear(reaccion, 0) + "";
                    txtAltura.setText(sAltura);
                    txtBrazoExtendido.setText(sBrazoExtendido);
                    txtSalto.setText(sSalto);
                    txtReaccion.setText(sReaccion.replace(".0", ""));
            }
            jButton5.setEnabled(true);
        } catch (Exception ex) {
            Logger.getLogger(DesktopApplication1View.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//GEN-LAST:event_jButton5ActionPerformed

    private void ddPuertoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ddPuertoActionPerformed
        // TODO add your handling code here:

        try {
            Parameters settings;
            settings =
                    new Parameters();
            //intance port
            String puerto = ddPuerto.getSelectedItem().toString();
            settings.setPort(puerto);
            settings.setBaudRate("19200");
            //Instance COM1.
            com =
                    new Com(settings);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }//GEN-LAST:event_ddPuertoActionPerformed

    private void btnFuerzaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFuerzaActionPerformed
        // TODO add your handling code here:

        if (txttricepsder.getText().length() <= 0) {
            lblError.setText("Ingrese triceps derecho");
            return;
        }
        if (txttriceptsizq.getText().length() <= 0) {
            lblError.setText("Ingrese triceps izquierdo");
            return;
        }
        if (txtbicepsder.getText().length() <= 0) {
            lblError.setText("Ingrese biceps derecho");
            return;
        }
        if (txtbicepsizq.getText().length() <= 0) {
            lblError.setText("Ingrese biceps izquierdo");
            return;
        }
        if (txtCuadricepsDer.getText().length() <= 0) {
            lblError.setText("Ingrese cuadriceps derecho");
            return;
        }
        if (txtCuadricepsIzq.getText().length() <= 0) {
            lblError.setText("Ingrese cuadriceps izquierdo");
            return;
        }
        if (txtIzquiotibialDer.getText().length() <= 0) {
            lblError.setText("Ingrese izquiotibiales derecho");
            return;
        }
        if (txtIzquiotibialIzq.getText().length() <= 0) {
            lblError.setText("Ingrese izquiotibiales izquierdo");
            return;
        }

        IngresarConsulta();

        FachadaConsulta oFachadaConsulta = new FachadaConsulta();
        Consulta idConsulta = oFachadaConsulta.obtenerConsulta(idPull, idEvaluacionPaciente);
        
        CaracteristicasConsulta oCaracteristicasConsulta = new CaracteristicasConsulta();
/*
        oCaracteristicasConsulta.setCod_especialidad("FS2");
        oCaracteristicasConsulta.setId_especialista(txtCedula.getText());
        oCaracteristicasConsulta.setId_super("2");
        oCaracteristicasConsulta.setId_paciente(txtParticipante.getText());
        oCaracteristicasConsulta.setNro_evaluacion(new BigDecimal(evaluacion));
*/
        oCaracteristicasConsulta.setId_caracteristica("2265");
        oCaracteristicasConsulta.setCalificacion(txttricepsder.getText());
        oCaracteristicasConsulta.setIdConsulta(idConsulta.getIdConsulta());
        oCaracteristicasConsulta.setIdEvaluacionPaciente(idEvaluacionPaciente);        
        if (!ingresarFuerza(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2266");
        oCaracteristicasConsulta.setCalificacion(txttriceptsizq.getText());
        if (!ingresarFuerza(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2267");
        oCaracteristicasConsulta.setCalificacion(txtbicepsder.getText());
        if (!ingresarFuerza(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2268");
        oCaracteristicasConsulta.setCalificacion(txtbicepsizq.getText());
        if (!ingresarFuerza(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2269");
        oCaracteristicasConsulta.setCalificacion(txtCuadricepsDer.getText());
        if (!ingresarFuerza(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2270");
        oCaracteristicasConsulta.setCalificacion(txtCuadricepsIzq.getText());
        if (!ingresarFuerza(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2271");
        oCaracteristicasConsulta.setCalificacion(txtIzquiotibialDer.getText());
        if (!ingresarFuerza(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2272");
        oCaracteristicasConsulta.setCalificacion(txtIzquiotibialIzq.getText());
        if (!ingresarFuerza(oCaracteristicasConsulta)) {
            return;
        }
        verConsultas();
        lblError.setForeground(Color.BLACK);
        lblError.setText("Registro ingresado");
    }//GEN-LAST:event_btnFuerzaActionPerformed

    private void btnSaltabilidadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaltabilidadActionPerformed

        IngresarConsulta();
        FachadaConsulta oFachadaConsulta = new FachadaConsulta();        
        Consulta idConsulta = oFachadaConsulta.obtenerConsulta(idPull, idEvaluacionPaciente);
        
        CaracteristicasConsulta oCaracteristicasConsulta = new CaracteristicasConsulta();
//        oCaracteristicasConsulta.setCod_especialidad("FS2");
//        oCaracteristicasConsulta.setId_especialista(txtCedula.getText());
//        oCaracteristicasConsulta.setId_super("1");
//        oCaracteristicasConsulta.setId_paciente(txtParticipante.getText());
//        oCaracteristicasConsulta.setNro_evaluacion(new BigDecimal(evaluacion));
        oCaracteristicasConsulta.setId_caracteristica("2260");
        oCaracteristicasConsulta.setCalificacion(txtAltura.getText());
        oCaracteristicasConsulta.setIdConsulta(idConsulta.getIdConsulta());
        if (!ingresarSaltabilidad(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2261");
        oCaracteristicasConsulta.setCalificacion(txtBrazoExtendido.getText());
        if (!ingresarSaltabilidad(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2262");
        oCaracteristicasConsulta.setCalificacion(txtSalto.getText());
        if (!ingresarSaltabilidad(oCaracteristicasConsulta)) {
            return;
        }

        oCaracteristicasConsulta.setId_caracteristica("2263");
        double oculoManual = new Double(txtReaccion.getText().toString());
        oCaracteristicasConsulta.setCalificacion(String.valueOf(redondear(oculoManual, 2) / 100));
        if (!ingresarSaltabilidad(oCaracteristicasConsulta)) {
            return;
        }

        double salto = new Double(txtSalto.getText());
        double brazoExtendido = new Double(txtBrazoExtendido.getText());
        double saltabilidad = salto - brazoExtendido;
        oCaracteristicasConsulta.setId_caracteristica("2264");
        oCaracteristicasConsulta.setCalificacion(String.valueOf(saltabilidad));
        if (!ingresarSaltabilidad(oCaracteristicasConsulta)) {
            return;
        }
        verConsultas();
        lblError.setForeground(Color.BLACK);
        lblError.setText("Registro ingresado");
    }//GEN-LAST:event_btnSaltabilidadActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        if (!validarCampos()) {
            return;
        }

        if (txtApellido.getText().length() > 0) {
            verConsultasApellido(txtApellido.getText().toString());
        }
    }//GEN-LAST:event_jButton4ActionPerformed

    private void txttricepsderMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txttricepsderMouseClicked
        txttricepsder.setText(lblKilos.getText());
        lblKilos.setText("0.0");
    }//GEN-LAST:event_txttricepsderMouseClicked

    private void txttriceptsizqMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txttriceptsizqMouseClicked
        txttriceptsizq.setText(lblKilos.getText());
        lblKilos.setText("0.0");
    }//GEN-LAST:event_txttriceptsizqMouseClicked

    private void txtbicepsderMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtbicepsderMouseClicked
        txtbicepsder.setText(lblKilos.getText());
        lblKilos.setText("0.0");
    }//GEN-LAST:event_txtbicepsderMouseClicked

    private void txtbicepsizqMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtbicepsizqMouseClicked
        txtbicepsizq.setText(lblKilos.getText());
        lblKilos.setText("0.0");
    }//GEN-LAST:event_txtbicepsizqMouseClicked

    private void txtCuadricepsDerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtCuadricepsDerMouseClicked
        txtCuadricepsDer.setText(lblKilos.getText());
        lblKilos.setText("0.0");
    }//GEN-LAST:event_txtCuadricepsDerMouseClicked

    private void txtCuadricepsIzqMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtCuadricepsIzqMouseClicked
        txtCuadricepsIzq.setText(lblKilos.getText());
        lblKilos.setText("0.0");
    }//GEN-LAST:event_txtCuadricepsIzqMouseClicked

    private void txtIzquiotibialDerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtIzquiotibialDerMouseClicked
        txtIzquiotibialDer.setText(lblKilos.getText());
        lblKilos.setText("0.0");
    }//GEN-LAST:event_txtIzquiotibialDerMouseClicked

    private void txtIzquiotibialIzqMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtIzquiotibialIzqMouseClicked
        txtIzquiotibialIzq.setText(lblKilos.getText());
        lblKilos.setText("0.0");
    }//GEN-LAST:event_txtIzquiotibialIzqMouseClicked

private void txt10MetrosKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt10MetrosKeyTyped
// TODO add your handling code here:
}//GEN-LAST:event_txt10MetrosKeyTyped

private void distanciacono2KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_distanciacono2KeyTyped
if(!Character.isDigit(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()))
{
     Toolkit.getDefaultToolkit().beep();
     evt.consume();
 }// TODO add your handling code here:
}//GEN-LAST:event_distanciacono2KeyTyped

private void distanciacono1KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_distanciacono1KeyTyped
if(!Character.isDigit(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()))
{
     Toolkit.getDefaultToolkit().beep();
     evt.consume();
 }// TODO add your handling code here:
}//GEN-LAST:event_distanciacono1KeyTyped

private void distanciacono3KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_distanciacono3KeyTyped
if(!Character.isDigit(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()))
{
     Toolkit.getDefaultToolkit().beep();
     evt.consume();
 }// TODO add your handling code here:
}//GEN-LAST:event_distanciacono3KeyTyped

private void distanciacono4KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_distanciacono4KeyTyped

    if(!Character.isDigit(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()))
{
     Toolkit.getDefaultToolkit().beep();
     evt.consume();
 }// TODO add your handling code here:
}//GEN-LAST:event_distanciacono4KeyTyped

private void distanciacono5KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_distanciacono5KeyTyped
if(!Character.isDigit(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()))
{
     Toolkit.getDefaultToolkit().beep();
     evt.consume();
 }// TODO add your handling code here:
}//GEN-LAST:event_distanciacono5KeyTyped

private void btnVelocidadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVelocidadActionPerformed
// TODO add your handling code here:

       if ((txt10Metros.getText().length() <= 0) && (habilitadocono1.isSelected())){
            lblError.setText("No se encuentran resultados para los primeros conos, \n o no estan seleccionados, estos se promediaran");
            return;
        }

        if ((txt20Metros.getText().length() <= 0) && (habilitadocono2.isSelected())) {
            lblError.setText("No se encuentran resultados para los segundos conos");
            return;
        }
        if ((txt30Metros.getText().length() <= 0) && (habilitadocono3.isSelected())){
            lblError.setText("No se encuentran resultados para los terceros conos");
            return;
        }
        if ((txt40Metros.getText().length() <= 0) && (habilitadocono4.isSelected())){
            lblError.setText("No se encuentran resultados para los cuartos conos");
            return;
        }
        if (txt50Metros.getText().length() <= 0) {
            lblError.setText("No se encuentran resultados para ultimos conos");
            return;
        }

         if 
            (distanciacono1.getText().length() <= 0) {
            lblError.setText("No ha ingresado la distancia para el primer par de conos");
            return;
        }
        if (distanciacono2.getText().length() <= 0) {
            lblError.setText("No ha ingresado la distancia para el segundo par de conos");
            return;
        }
        if (distanciacono3.getText().length() <= 0) {
            lblError.setText("No ha ingresado la distancia para el tercer par de conos");
            return;
        }
        if (distanciacono4.getText().length() <= 0) {
            lblError.setText("No ha ingresado la distancia para el cuarto par de conos");
            return;
        }
        if (distanciacono5.getText().length() <= 0) {
            lblError.setText("No ha ingresado la distancia para el quinto par de conos");
            return;
        }
        
        IngresarConsulta();
        
        FachadaConsulta oFachadaConsulta = new FachadaConsulta();        
        Consulta idConsulta = oFachadaConsulta.obtenerConsulta(idPull, idEvaluacionPaciente);
        
        CaracteristicasConsulta oCaracteristicasConsulta = new CaracteristicasConsulta();
        
      
       // oCaracteristicasConsulta.setId_caracteristica("2273");
        oCaracteristicasConsulta.setCalificacion(txt10Metros.getText());
        oCaracteristicasConsulta.setIdConsulta(idConsulta.getIdConsulta());
        oCaracteristicasConsulta.setIdEvaluacionPaciente(idEvaluacionPaciente);

       
        if(!habilitadocono1.isSelected()) {
                
              oCaracteristicasConsulta.setId_caracteristica("2273");      
             // lblError.setText("No ha habilitado el cono 1, este sera promediado");
              int segundose = 00;
              String segundos = Integer.toString(segundose);
              segundos = segundos.replace(":", ".");
              oCaracteristicasConsulta.setCalificacion(segundos);
              if (!ingresar(oCaracteristicasConsulta)) {
                return; } } 
         else   {      
               oCaracteristicasConsulta.setId_caracteristica("2273");      
              String segundos = txt10Metros.getText();
              segundos = segundos.replace(":", ".");
            //  String minutos = txt10Metros.getText().substring(2);
              oCaracteristicasConsulta.setCalificacion(segundos);
              if (!ingresar(oCaracteristicasConsulta)) {
              return;
                }}   



        if    (!habilitadocono2.isSelected()) {
              oCaracteristicasConsulta.setId_caracteristica("2274");      
              //lblError.setText("No ha habilitado el cono 2, este sera promediado"); 
              int segundose = 00;
              String segundos = Integer.toString(segundose);
              segundos = segundos.replace(":", ".");
              oCaracteristicasConsulta.setCalificacion(segundos);
              if (!ingresar(oCaracteristicasConsulta)) {
                return; } } 
         else   {
            oCaracteristicasConsulta.setId_caracteristica("2274");      
            String segundos = txt20Metros.getText();
            segundos = segundos.replace(":", ".");
           // String minutos = segundos.replace(":", "."); con esta linea se ponen los : puntos en la table
            //ejemplo 1:30:478
             oCaracteristicasConsulta.setCalificacion(segundos);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                }}   


 
        if    (!habilitadocono3.isSelected()) {
              oCaracteristicasConsulta.setId_caracteristica("2275");      
             // lblError.setText("No ha habilitado el cono 3, este sera promediado"); 
              int segundose = 00;
              String segundos = Integer.toString(segundose);
              segundos = segundos.replace(":", ".");
              oCaracteristicasConsulta.setCalificacion(segundos);
              if (!ingresar(oCaracteristicasConsulta)) {
                return; } } 
         else   {
             oCaracteristicasConsulta.setId_caracteristica("2275"); 
             String segundos = txt30Metros.getText();     
             segundos = segundos.replace(":", ".");
             oCaracteristicasConsulta.setCalificacion(segundos);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                }}   

 
        if    (!habilitadocono4.isSelected()) {
              oCaracteristicasConsulta.setId_caracteristica("2276");      
           //   lblError.setText("No ha habilitado el cono 4, este sera promediado"); 
              int segundose = 00;
              String segundos = Integer.toString(segundose);
              segundos = segundos.replace(":", ".");
              oCaracteristicasConsulta.setCalificacion(segundos);
              if (!ingresar(oCaracteristicasConsulta)) {
                return; } } 
         else   {   
            oCaracteristicasConsulta.setId_caracteristica("2276");      
            String segundos = txt40Metros.getText();
             segundos = segundos.replace(":", ".");
             oCaracteristicasConsulta.setCalificacion(segundos);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                }}   
            
             oCaracteristicasConsulta.setId_caracteristica("2277");      
             String segundos = txt50Metros.getText();
             segundos = segundos.replace(":", ".");
             oCaracteristicasConsulta.setCalificacion(segundos);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                }    
            
                // Distancias para velocidad
              oCaracteristicasConsulta.setId_caracteristica("2278");      
             String distancia = distanciacono1.getText();
             oCaracteristicasConsulta.setCalificacion(distancia);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                }    
            oCaracteristicasConsulta.setId_caracteristica("2279");      
             distancia = distanciacono2.getText();
             oCaracteristicasConsulta.setCalificacion(distancia);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                }    
            oCaracteristicasConsulta.setId_caracteristica("2280");      
             distancia = distanciacono3.getText();
             oCaracteristicasConsulta.setCalificacion(distancia);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                }   

            oCaracteristicasConsulta.setId_caracteristica("2281");      
             distancia = distanciacono4.getText();
             oCaracteristicasConsulta.setCalificacion(distancia);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                }             
            
            oCaracteristicasConsulta.setId_caracteristica("2282");      
             distancia = distanciacono5.getText();
             oCaracteristicasConsulta.setCalificacion(distancia);
             if (!ingresar(oCaracteristicasConsulta)) {
            return;
                } 
        lblError.setForeground(Color.BLUE);
        lblError.setText("El registro se ingresó satisfactoriamente.");

                                                 

}//GEN-LAST:event_btnVelocidadActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnFuerza;
    private javax.swing.JButton btnSaltabilidad;
    private javax.swing.JButton btnVelocidad;
    private javax.swing.JComboBox ddPruebas;
    private javax.swing.JComboBox ddPuerto;
    private javax.swing.JComboBox ddTurnos;
    private javax.swing.JTextField distanciacono1;
    private javax.swing.JTextField distanciacono2;
    private javax.swing.JTextField distanciacono3;
    private javax.swing.JTextField distanciacono4;
    private javax.swing.JTextField distanciacono5;
    private javax.swing.JCheckBox habilitadocono1;
    private javax.swing.JCheckBox habilitadocono2;
    private javax.swing.JCheckBox habilitadocono3;
    private javax.swing.JCheckBox habilitadocono4;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lblError;
    private javax.swing.JLabel lblKilos;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JTable tableConsultas;
    private javax.swing.JTextField txt10Metros;
    private javax.swing.JTextField txt20Metros;
    private javax.swing.JTextField txt30Metros;
    private javax.swing.JTextField txt40Metros;
    private javax.swing.JTextField txt50Metros;
    private javax.swing.JTextField txtAltura;
    private javax.swing.JTextField txtApellido;
    private javax.swing.JTextField txtBrazoExtendido;
    private javax.swing.JTextField txtCedula;
    private javax.swing.JTextField txtCuadricepsDer;
    private javax.swing.JTextField txtCuadricepsIzq;
    private javax.swing.JTextField txtEnsayo;
    private javax.swing.JTextField txtIzquiotibialDer;
    private javax.swing.JTextField txtIzquiotibialIzq;
    private javax.swing.JLabel txtNombreParticipante;
    private javax.swing.JLabel txtParticipante;
    private javax.swing.JLabel txtParticipante1;
    private javax.swing.JTextField txtPull;
    private javax.swing.JTextField txtReaccion;
    private javax.swing.JTextField txtSalto;
    private javax.swing.JTextField txtbicepsder;
    private javax.swing.JTextField txtbicepsizq;
    private javax.swing.JTextField txttricepsder;
    private javax.swing.JTextField txttriceptsizq;
    // End of variables declaration//GEN-END:variables
    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;
    private JDialog aboutBox;

    private void verConsultas() {

        FachadaCita oFachadaCita = new FachadaCita();

        pacientesxDia =
                oFachadaCita.findByPacienteEval(
                new java.sql.Date(calendario.getTime().getTime()),
                ddTurnos.getSelectedIndex() + "",
                txtPull.getText(),
                txtCedula.getText(),
                ddPruebas.getSelectedItem().toString());

        if (pacientesxDia == null) {
            lblError.setText("No existen participantes en este horario");
            return;

        } else if (pacientesxDia.isEmpty()) {
            lblError.setText("No existen participantes en este horario");
            return;

        } else {
            //    lblError.setText("");
        }
//definir valores de filas

        Vector colNames = new Vector(5);
        colNames.addElement("Identificación");
        colNames.addElement("Apellidos");
        colNames.addElement("Nombres");
        colNames.addElement("Institución");
        colNames.addElement("Pull");
        colNames.addElement("EvaluacionPaciente");
//        colNames.addElement("T");

        //llenar la tabla
        Vector rows = new Vector();
        for (int i = 0; i < pacientesxDia.size(); i++) {//oRevisiones.size();
            ConsultaCita oConsulta = pacientesxDia.get(i);
            Vector row = new Vector();
            row.addElement(oConsulta.getIdUsuario());
            row.addElement(oConsulta.getNombres());
            row.addElement(oConsulta.getApellido());
            row.addElement(oConsulta.getInstitucion());
            row.addElement(oConsulta.getIdPull());
            row.addElement(oConsulta.getIdEvaluacionPaciente()); 

            rows.addElement(row);
        }
//Instanciar el modelo de tabla
        DefaultTableModel model = new DefaultTableModel(rows, colNames);
        tableConsultas.setModel(model);

        //seleccion de filas
        tableConsultas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);



        ListSelectionModel rowSM = tableConsultas.getSelectionModel();

        rowSM.addListSelectionListener(new ListSelectionListener() {

            public void valueChanged(ListSelectionEvent e) {
                ListSelectionModel lsm = (ListSelectionModel) e.getSource();
                if (lsm.isSelectionEmpty()) {
                    System.out.println("no filas seleccionadas");
                    //no rows are selected
                } else {
                    int selectedRow = lsm.getMinSelectionIndex();
                    ///selectedRow is selected
                    System.out.println("Fila seleccionadaaaa " + selectedRow);
//                    jTabbedPane1.setSelectedIndex(ddPruebas.getSelectedIndex() + 1);
                    ConsultaCita oConsulta = pacientesxDia.get(selectedRow);
                    txtParticipante.setText(oConsulta.getIdUsuario());
                    txtNombreParticipante.setText(oConsulta.getApellido() + " " + oConsulta.getNombres());
                    evaluacion =  Integer.parseInt(oConsulta.getEvaluacion());
                    idPull = oConsulta.getIdPull();
                    idEvaluacionPaciente = oConsulta.getIdEvaluacionPaciente();                                        

                    //conseguir la consulta para saber cual es la eval y poder mostrar los campos
                    mostrarResultados(oConsulta.getIdUsuario(), oConsulta.getEvaluacion(), oConsulta.getIdEvaluacionPaciente()  );
                }

            }
        });
        setColorTable();

    }

    private void setColorTable() {
        //color de fila
        ColorRenderer cr = new ColorRenderer("Identificación", pacientesxDia);
        tableConsultas.getColumn(tableConsultas.getColumnName(0)).setCellRenderer(cr);
    }

    public java.sql.Date fechaMenos(java.sql.Date fch, int dias) {
        Calendar cal = new GregorianCalendar();
        cal.setTimeInMillis(fch.getTime());
        cal.add(Calendar.DATE, -dias);
        return new Date(cal.getTimeInMillis());
    }

    public java.sql.Date fechaMas(java.sql.Date fch, int dias) {
        Calendar cal = new GregorianCalendar();
        cal.setTimeInMillis(fch.getTime());
        cal.add(Calendar.DATE, dias);
        return new Date(cal.getTimeInMillis());
    }

    private void ponerFecha() {
        int dia = calendario.get(Calendar.DAY_OF_MONTH);
        int mes = calendario.get(Calendar.MONTH);
        int ano = calendario.get(Calendar.YEAR);
        txtEnsayo.setText("" + dia + "-" + (mes + 1) + "-" + ano);
    }

    private boolean ingresar(CaracteristicasConsulta oCaracteristica) {
        FachadaFisico1 oFachadaFisico1 = new FachadaFisico1();
        String sResultado = oFachadaFisico1.insertarPrueba50m(oCaracteristica);
        if (sResultado != null) {
            if (sResultado.equals("1")) {
                lblError.setVisible(true);
                lblError.setText("El registro fue actualizado con éxito");
            }

            if (sResultado.equals("2")) {
                lblError.setVisible(true);
                lblError.setText("Ocurrio un error al ingresar el registro, consultar al administrador del sistema" + "foreign_key_violation");
            }

            if (sResultado.equals("3")) {
                lblError.setVisible(true);
                lblError.setText("Ocurrio un error al ingresar el registro, consultar al administrador del sistema" + "not_null_violation");
            }

        } else {
            lblError.setVisible(true);

            lblError.setText("El registro ha sido ingresado con exito");
        }

        return true;
    }

    private boolean ingresarFuerza(CaracteristicasConsulta oCaracteristica) {
        FachadaFisico2 oFachadaFisico2 = new FachadaFisico2();
        String sResultado = oFachadaFisico2.insertarFuerza(oCaracteristica);
        if (sResultado != null) {
            if (sResultado.equals("1")) {
                lblError.setVisible(true);
                lblError.setText("El registro fue actualizado con éxito");
            }

            if (sResultado.equals("2")) {
                lblError.setVisible(true);
                lblError.setText("Ocurrio un error al ingresar el registro, consultar al administrador del sistema" + "foreign_key_violation");
            }

            if (sResultado.equals("3")) {
                lblError.setVisible(true);
                lblError.setText("Ocurrio un error al ingresar el registro, consultar al administrador del sistema" + "not_null_violation");
            }

        } else {
            lblError.setVisible(true);
            lblError.setText("El registro ha sido ingresado con exito");
        }

        return true;
    }
    
        private boolean ingresarSaltabilidad(CaracteristicasConsulta oCaracteristica) {
        FachadaFisico2 oFachadaFisico2 = new FachadaFisico2();
        String sResultado = oFachadaFisico2.insertarSaltabilidad(oCaracteristica);
        if (sResultado != null) {
            if (sResultado.equals("1")) {
                lblError.setVisible(true);
                lblError.setText("El registro fue actualizado con éxito");
            }

            if (sResultado.equals("2")) {
                lblError.setVisible(true);
                lblError.setText("Ocurrio un error al ingresar el registro, consultar al administrador del sistema" + "foreign_key_violation");
            }

            if (sResultado.equals("3")) {
                lblError.setVisible(true);
                lblError.setText("Ocurrio un error al ingresar el registro, consultar al administrador del sistema" + "not_null_violation");
            }

        } else {
            lblError.setVisible(true);
            lblError.setText("El registro ha sido ingresado con exito");
        }

        return true;
    }

    public Double redondear(
            Double numero, int decimales) {
        return Math.round(numero * Math.pow(10, decimales)) / Math.pow(10, decimales);
    }

    public double getFuerza(int a, int b, String resultado) {
        // long value = Long.parseLong(resultado.substring(a, b), 16);
        double d = Double.parseDouble(resultado.substring(a, b));
        d = redondear(d, 2);
        return d;
    }

    public String getSaltabilidad(
            int a, int b, String resultado) {
        long value = Long.parseLong(resultado.substring(a, b), 16);
        double d = (double) value;
        d =
                redondear(d, 2);
        String retorno = (d / 100) + "";
        return retorno;
    }

    private boolean validarCampos() {

        if (ddPruebas.getSelectedIndex() == 0) {
            lblError.setText("Debe seleccionar la prueba que desea iniciar");
            jButton5.setEnabled(true);
            return false;
        }

        if (ddPuerto.getSelectedIndex() == 0) {
            lblError.setText("Seleccione el puerto (Ver administrador de dispositivos)");
            jButton5.setEnabled(true);
            return false;
        }

        if (txtCedula.getText().toString().length() == 0) {
            lblError.setText("Ingrese el especialista");
            jButton5.setEnabled(true);
            return false;
        }

        if (txtPull.getText().toString().length() == 0) {
            lblError.setText("Ingrese el pull al que pertenece el especialista");
            jButton5.setEnabled(true);
            return false;
        }

        return true;


    }

    public Component getTableCellRendererComponent(
            JTable table, Object value, boolean isSelected,
            boolean hasFocus, int row, int col) {
        Component comp = this.getTableCellRendererComponent(
                table, value, isSelected, hasFocus, row, col);

        String s = table.getModel().getValueAt(row, 1).toString();

        if (s.equalsIgnoreCase("Fail")) {
            comp.setForeground(Color.red);
        } else {
            comp.setForeground(null);
        }

        return (comp);
    }

    private void verConsultasApellido(String apellido) {

        //comenzar por mayuscula
        apellido = apellido.substring(0, 1).toUpperCase() + apellido.substring(1);

        FachadaCita oFachadaCita = new FachadaCita();
        pacientesxDia =
                oFachadaCita.findPacientesByApellido(apellido,
                new java.sql.Date(calendario.getTime().getTime()),
                txtPull.getText(),
                txtCedula.getText(),
                ddPruebas.getSelectedItem().toString());


        if (pacientesxDia == null) {
            lblError.setText("No existen participantes para este apellido");
            return;

        } else if (pacientesxDia.isEmpty()) {
            lblError.setText("No existen participantes para este apellido");
            return;

        } else {
            lblError.setText("");
        }
//definir valores de filas

        Vector colNames = new Vector(4);
        colNames.addElement("Identificación");
        colNames.addElement("Nombres");
        colNames.addElement("Apellidos");
        colNames.addElement("Institución");


        //llenar la tabla
        Vector rows = new Vector();
        for (int i = 0; i <
                pacientesxDia.size(); i++) {//oRevisiones.size();
            ConsultaCita oConsulta = pacientesxDia.get(i);
            Vector row = new Vector();
            row.addElement(oConsulta.getIdUsuario());
            row.addElement(oConsulta.getNombres());
            row.addElement(oConsulta.getApellido());
            row.addElement(oConsulta.getInstitucion());

            rows.addElement(row);
        }

//Instanciar el modelo de tabla
        DefaultTableModel model = new DefaultTableModel(rows, colNames);
        tableConsultas.setModel(model);

        //seleccion de filas
        tableConsultas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);



        ListSelectionModel rowSM = tableConsultas.getSelectionModel();

        rowSM.addListSelectionListener(new ListSelectionListener() {

            public void valueChanged(ListSelectionEvent e) {
                ListSelectionModel lsm = (ListSelectionModel) e.getSource();
                if (lsm.isSelectionEmpty()) {
                    System.out.println("no filas seleccionadas");
                    //no rows are selected
                } else {
                    int selectedRow = lsm.getMinSelectionIndex();
                    ///selectedRow is selected
                    System.out.println("Fila seleccionadaaaa " + selectedRow);
//                    jTabbedPane1.setSelectedIndex(ddPruebas.getSelectedIndex() + 1);
                    ConsultaCita oConsulta = pacientesxDia.get(selectedRow);
                    txtParticipante.setText(oConsulta.getIdUsuario());
                    txtNombreParticipante.setText(oConsulta.getApellido() + " " + oConsulta.getNombres());
                    evaluacion = Integer.parseInt(oConsulta.getEvaluacion());
                    
                    idPull = oConsulta.getIdPull();
                    idEvaluacionPaciente = oConsulta.getIdEvaluacionPaciente();                                        

                    //conseguir la consulta para saber cual es la eval y poder mostrar los campos
                    mostrarResultados(oConsulta.getIdUsuario(), oConsulta.getEvaluacion(), oConsulta.getIdEvaluacionPaciente());
                }

            }
        });
        setColorTable();

    }

    private void mostrarResultados(String usuario, String evaluacion, String evaluacionPacienteId) {
        limpiarCampos();
        FachadaFisico2 oFachadaFisico2 = new FachadaFisico2();
        ArrayList datos = oFachadaFisico2.getDiagnosticoFuerzaByPacienteEvaluacion(usuario, Integer.parseInt(evaluacion), Integer.parseInt(evaluacionPacienteId));

        for (int i = 0; i <
                datos.size(); i++) {

            CaracteristicasConsulta oCaracteristicasConsulta = new CaracteristicasConsulta();
            oCaracteristicasConsulta =
                    (CaracteristicasConsulta) datos.get(i);

            switch (Integer.parseInt(oCaracteristicasConsulta.getId_super())) {


                case 1: //Saltabilidad  

                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("AlturaSent")) {
                        txtAltura.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("AlcanceMax")) {
                        txtBrazoExtendido.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("Salto")) {
                        txtSalto.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("ReacOcul")) {
                        txtReaccion.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }




                case 2:  //Fuerza

                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("FTrBDer")) {
                        txttricepsder.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("FTrBIzq")) {
                        txttriceptsizq.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("FBiscDer")) {
                        txtbicepsder.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("FBiscIzq")) {
                        txtbicepsizq.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("FCuadPDer")) {
                        txtCuadricepsDer.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("FCuadIzq")) {
                        txtCuadricepsIzq.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }




                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("FIsquiDer")) {
                        txtIzquiotibialDer.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }



                    if (oCaracteristicasConsulta.getId_caracteristica().equalsIgnoreCase("FIsquiIzq")) {
                        txtIzquiotibialIzq.setText(oCaracteristicasConsulta.getCalificacion());
                        break;

                    }




            }
        }

        //Velocidad

        FachadaFisico1 oFachadaFisico1 = new FachadaFisico1();

        ArrayList velocidad = oFachadaFisico1.getPrueba50m(usuario, evaluacion);


        for (int i = 0; i <
                velocidad.size(); i++) {
            Prueba50m oPrueba50m = (Prueba50m) velocidad.get(i);

            if (oPrueba50m.getId().equals("1")) {
                txt10Metros.setText(formatear(oPrueba50m.getMetros()));

            }

            if (oPrueba50m.getId().equals("2")) {
                txt20Metros.setText(formatear(oPrueba50m.getMetros()));

            }

            if (oPrueba50m.getId().equals("3")) {
                txt30Metros.setText(formatear(oPrueba50m.getMetros()));

            }

            if (oPrueba50m.getId().equals("4")) {
                txt40Metros.setText(formatear(oPrueba50m.getMetros()));

            }

            if (oPrueba50m.getId().equals("5")) {
                txt50Metros.setText(formatear(oPrueba50m.getMetros()));

            }

        }


    }

    private void limpiarCampos() {
        //Velocidad
        txt10Metros.setText("");
        txt20Metros.setText("");
        txt30Metros.setText("");
        txt40Metros.setText("");
        txt50Metros.setText("");

        //Fuerza
        txtCuadricepsDer.setText("");
        txtCuadricepsIzq.setText("");
        txtIzquiotibialDer.setText("");
        txtIzquiotibialIzq.setText("");
        txtbicepsder.setText("");
        txtbicepsizq.setText("");
        txttricepsder.setText("");
        txttriceptsizq.setText("");

        //saltabilidad
        txtSalto.setText("");
        txtBrazoExtendido.setText("");
        txtAltura.setText("");
        txtReaccion.setText("");

    }

    private String formatear(String metros) {
        metros = "0:" + metros;
        return validarMilesimas(metros.replace(".", ":"),":");
    }

    private String validarMilesimas(String calificacion, String token) {
        String[] resultado = calificacion.split(token);
        String milesimas = resultado[resultado.length - 1];
        if (milesimas.length() == 2) {
            milesimas = "0" + milesimas;
            resultado[resultado.length - 1] = milesimas;

            String sResult = "";
            for (int i = 0; i < resultado.length; i++) {
                String string = resultado[i];
                if(token.equals(":")){
                 sResult = sResult + ":" + string;
                }else{
                sResult = sResult + "." + string;
                }
                
            }
            return sResult.substring(1, sResult.length());

        }
        return calificacion;

    }
}
